<?php
//ctype_punct(mixed $text): bool
//ctype_punct — 检测可打印的字符,不包含空白、数字和字母
$aa = "ABasdk!@!$#";
$bb = "!@ # $";
$cc = "*&$()";
if (ctype_punct($aa)) {
    echo '$aa ' . "ok" . PHP_EOL;
} else {
    echo '$aa ' . "no" . PHP_EOL;

}

if (ctype_punct($bb)) {
    echo '$bb ' . "ok" . PHP_EOL;
} else {
    echo '$bb ' . "no" . PHP_EOL;

}
if (ctype_punct($cc)) {
    echo '$cc ' . "ok" . PHP_EOL;
} else {
    echo '$cc ' . "no" . PHP_EOL;

}
